add midpoint displacement algorithm