Corrected map code (possibly)