Added some code to support custom world generation