buttonAction :: IORef GameState -> Int -> Int -> IO ()
buttonAction gameStateRef side k = do
  gameState <- readIORef gameStateRef
  let rotStep = getRotStep gameState
      n = getN gameState
      d = getDrawingArea gameState
      rp = case side of 
                0 -> rotPlane n 0 (k-1) . negate
                1 -> rotPlane n 1 (k-1) . negate
                2 -> rotPlane n 0 (k-1)
                3 -> rotPlane n 1 (k-1)
                4 -> rotPlane n 0 1
                5 -> rotPlane n 0 1 . negate
  modifyIORef gameStateRef (\gS -> gS { getViewPoint = rp rotStep <> getViewPoint gS })
  widgetQueueDraw d
buttonAction :: IORef GameState -> Int -> Int -> IO ()
buttonAction gameStateRef side k = do
  gameState <- readIORef gameStateRef
  let rotStep = getRotStep gameState
      n = getN gameState
      d = getDrawingArea gameState
      rp = case side of 
                0 -> rotPlane n 0 (k-1) . negate
                1 -> rotPlane n 1 (k-1) . negate
                2 -> rotPlane n 0 (k-1)
                3 -> rotPlane n 1 (k-1)
                4 -> rotPlane n 0 1
                5 -> rotPlane n 0 1 . negate
  modifyIORef gameStateRef (\gS -> gS { getViewPoint = rp rotStep <> getViewPoint gS })
  widgetQueueDraw d
buttonAction gameStateRef side k = do
  gameState <- readIORef gameStateRef
  let rotStep = getRotStep gameState
      n = getN gameState
      d = getDrawingArea gameState
      rp = case side of 
                0 -> rotPlane n 0 (k-1) . negate
                1 -> rotPlane n 1 (k-1) . negate
                2 -> rotPlane n 0 (k-1)
                3 -> rotPlane n 1 (k-1)
                4 -> rotPlane n 0 1
                5 -> rotPlane n 0 1 . negate
  modifyIORef gameStateRef (\gS -> gS { getViewPoint = rp rotStep <> getViewPoint gS })
  widgetQueueDraw d