updated bezier curve formula