correcting the board flip functionality according to new changes