some fixes in terms of map

Mainly, make a intermediate function to get the keys we want. 
But it'll be a partial function that only returns true when the thing is in the set, it doesn't even need to consider the case when the set argument is missing.