implemented step 5a