Code for step-1