Homework example working for the most part.