tidied up the map function, no longer need to send in a key param.  ...added some tests too.