added board flip function