first working bezier solver