Add unit tests
Do it the (mostly) right way