Added last cleanup and tests.

Homework 3 done