Updated Code to include mapping