modified one of the exercises to use Collections.max()