Adding in map generation code (still needs fixing)