basic terrain recursion and clean up code