refactoring and created methods for question 10 -- still question 10 and 04 unsolved