converted loop list creation to list comprehension