fixed mapping function