Solving the remaining problems on the second set of exercises on lists