extended and answered question 6