Added the if else statements for map