                     let touchLocation = sender.location(in: boardView)
                     let offsetLocation = CGPoint(x: touchLocation.x - panOffset.x, y: touchLocation.y - panOffset.y)
                     
+                    if let activePool = self.activePool
+                    {
+                        if (activePool == topPoolView) && (touchLocation.y < 0) ||
+                            (activePool == bottomPoolView) && (touchLocation.y > boardView.frame.height)
+                        {
+                            activePool.addPiece(activePiece)
+                            self.activePiece = nil
+                            
+                            self.panStart = nil
+                            self.panOffset = nil
+                            
+                            return
+                        }
+                    }
+                    
                     activePiece.move(to: offsetLocation)
                     putdownActivePiece()
                     

                {
                    let boardTouchLocation = sender.location(in: boardView)
                    let offsetLocation = CGPoint(x: boardTouchLocation.x - pressOffset.x, y: boardTouchLocation.y - pressOffset.y)
                        
                    boardView.buildPiece(pressedPiece)
                    activePiece = pressedPiece
                    activePiece!.move(to: offsetLocation)

            
            if let winner = winner
            {
                messageLabel.text = "Game is over, \(winner) is the winner!"
            }
            else
