changed main algorithm for mid point displacement for terrain generation