improved terrain function a bit. #1