Completed code for assignment.