started on the control point and optimized the code a bit