replaced exception with assert for efficiency     in operator()
added operator() version that works with maps