Added algorithm to calculate the bezier curve