update code for step 6