Implementation of a map iterator