cleaned up some comments, fixed a few bugs, got all of the test cases working