fixed code for step 2