Terrain code working with some minor bugs.