added some tests. should have done tests first. bad me.