Implement assignment #2 with tests