added mapping function and library