Implemented all the todos and got the tests to work