preparing code for question 7 application