Several improvements to the code of CPController and its performance
Merge pull request #232 from VladimirTechMan/improve_cpcontroller

Several improvements to the code of CPController and its performance