Pretty much done for generating map code