make an OO version of solution

It is explicily slow.