Consider using a list comprehension here.