bug fixes and BTerrain class

Terrain class in progress