updated mapping function