Simplifies calc_costs with list comprehensions