wrote code and solved problem 2 of problem set 3, wewt