E. Software Implementation of Controlling Algorithm