Excercise 7, cleaned up