begin map generation code, fixed some things