rewrote code in Object Oriented style
Merge pull request #1 from jadjoubran/master

Pull request from jadjoubran's master