map works, though it is throwing some undefined errors.