code for world setup and mapping