Completed HW5 #3b)