Adding unit tests for assignment#2.
Implement the functions for the assignment.