started the code for the question.