add another solution of Question 7