added an Object Oriented version of the code
Merge branch 'dev'