my solution to lab4 in part A