Switching the naming convention to the ones of Camwire C project. Introducing try/catch blocks for exceptions. For easy code maintainability, I'm using the same variable names as suggested by Mr. Johann Schoonees