Problem 1 is implemented and tested