changed problem 1 to use a list comprehension
stylistic changes