Advanced OOP solution added.