implemented step 4