Final code submitted on Blackboard.

More cleanup.