Changed code for step 6