complete code for step1