Code for step-2