Moved terrain code to seperate class