Added two functions to complete the programming assignment.