Switched to OO coding

Migrated some code to OO implementation
Fixed issue #5