implement map bag abstract class and add functors