Completed my first function for the assignment.