bezier curve function moved to pointers