Solved Problem 8, fixed output text for Problem 7