Solve first week 3 in-class exercise