fixed solution to practice question 2