finished test cases and correcting code to make test cases work. Finally done. I think