refactored a bit
list comprehension