move movePieceToCell function to the view