FormCtrl: Finished the transformation of the MatLab code to C++