changing the code abit to better support multiple mapping