Solved problem 5, minor syntax improvements.