some progress on mapping function