     let backTexture: SKTexture
     var faceUp: Bool
     
-    var solitaireScene: SolitaireScene
-    var solitaireGame: Solitaire
+    weak var solitaireScene: SolitaireScene?
+    weak var solitaireGame: Solitaire?
     
     var toLocation: CGPoint?        // Where the user lifted their finger
     var fromLocation: CGPoint?      // Where the user began dragging
     
-    var newPile: StackPile?         // Pile to which the user dragged
-    var oldPile: StackPile?         // Original pile from which the user dragged
+    weak var newPile: StackPile?    // Pile to which the user dragged
+    weak var oldPile: StackPile?
+    // Original pile from which the user dragged
     
     var touchedHidden = false;      // Did the user touch a card that was face down?
     var flipHidden = false;         // Should the hidden card be flipped?

    // draws card from deck pile and places in waste pile
    // called when deck pile is tapped
    func drawCard() {
        toLocation = solitaireScene.snapToCGPoint(solitaireScene.wastePileLocation)
        newPile = solitaireGame.wastePile
        oldPile = solitaireGame.deck
        
        self.flipCardOver()
        self.zPosition = CGFloat(solitaireScene.SolitaireGame.wastePile.numberOfCards())
        
        solitaireScene.SolitaireGame.moveTopCard(oldPile!, toPile: newPile!)
        self.runAction(SKAction.moveTo(toLocation!, duration: 0.25))
        
        // If the deck is empty, reload the deck with cards from waste pile
        if solitaireGame.deck.numberOfCards() == 0 {
            solitaireScene.addReloadOption()
        }
    }
    

                moveCardsBack();
            } else if newPile != nil && oldPile != nil {
                // If both piles are valid determine where the card is going to and coming from and check if the move is valid
                if solitaireGame!.checkMove(card, previousPile: oldPile!, newPile: newPile!) {
                    if(toLocation! != fromLocation!) {
                        movePile();
                    }
