updated code for maps