implemented Terrain functions