Complete code from lecture. Ready to do the assignment.