Added terrain generation into the Terrain class. Made it exntend when the viewport gets near the end.