Implemented terrainFunction and findChar