Updated step 7 code