             ghost.physicsBody?.applyImpulse(CGVectorMake(0, 90))
 
         } else {
-            ghost.physicsBody?.velocity = CGVectorMake(0, 0)
-            ghost.physicsBody?.applyImpulse(CGVectorMake(0, 90))
+            
+            if died == true {
+                
+            } else {
+                ghost.physicsBody?.velocity = CGVectorMake(0, 0)
+                ghost.physicsBody?.applyImpulse(CGVectorMake(0, 90))
+            
+            }
+            
         }
         
     }


    var moveAndRemove = SKAction()
    
    var gameStarted = Bool()
    
    override func didMoveToView(view: SKView) {
        
        
        self.physicsWorld.contactDelegate = self
        
        ground = SKSpriteNode(imageNamed: "ground")
        ground.setScale(0.5)

        let scoreNode = SKSpriteNode()
        
        scoreNode.size = CGSize(width: 1, height: 200)
        scoreNode.position = CGPoint(x: self.frame.width, y: self.frame.height/2)
        scoreNode.physicsBody = SKPhysicsBody(rectangleOfSize: scoreNode.size)
        scoreNode.physicsBody?.affectedByGravity = false
        scoreNode.physicsBody?.dynamic = false
        scoreNode.physicsBody?.categoryBitMask = PhysicsCatagory.Score
        scoreNode.physicsBody?.collisionBitMask = 0
        scoreNode.physicsBody?.contactTestBitMask = PhysicsCatagory.Ghost
        scoreNode.color = SKColor.greenColor()
        
        wallPair = SKNode()
        
