Completed exercise 2 functionality.