You might be able to do a list comprehension here.