all coding for prob4 done