all coding for prob3 done