creating an OOP solver