added OOP solutions