hwk 10 completed. Might want to refactor...