correct string terrain function