Use list comprehension to simplify computation