implementation of reversi