modified week3.hs