Finished implementing tests, and fixing bugs to get all tests to pass