Finished first pass of unit tests, still have some bugs to work out