code to be completed for step1 & 2