map logic