Code for  HW1_PROBLEM