fixed some test issues
rewrote some tests
wrote some new tests