Implement project1 code to pass tests.