Wrote naive code for Ass3.Prob1