cleaning up terrain.cpp