Typed up the code from the assignment.