added chess logic