implemented step 3