updated map logic