debugging step3

and also adding new logic to step3