sodding variable name wrong which stopped the logic in the map method working. aaaagh!