Added a genFlatWorld function.