Improvement code for mapping