Added better terrain tile generation code