major refactor, now you need to pass an object to the map method