Worked on genFlatworld().