Created the functions needed for the assignment.