Updated code for assignment.

Completed assignment code.