Implemented part C of step 3