completing the sqaure method for turning point