reworked bezier math