Function map now handles reverse iteration.