added some more unit tests and cleaned it up for a bit