OO code. Working version. Playing strategy can be optimized further