                     MenuScene?.size = (self.view?.bounds.size)!
                     self.view?.presentScene(MenuScene!, transition: SKTransition.push(with: .up, duration: 0.5))
                    
-                } else if node.name == "Retry Label" {
+                } else if node.name == "Retry Button" {
                     
                     let GameplayScene = GameScene(fileNamed: "GameScene")
                     GameplayScene?.scaleMode = .aspectFill
                     GameplayScene?.size = (self.view?.bounds.size)!
                     self.view?.presentScene(GameplayScene!, transition: SKTransition.push(with: .up, duration: 0.5))
 
+                } else if node.name == "Stats Button" {
+                    
+                    //Database Stuff
+                    print("stats")
+                    //created NSURL
+                    let requestURL = NSURL(string: URL_SAVE_TEAM) //change to our url
+                    
+                    //creating NSMutableURLRequest
+                    let request = NSMutableURLRequest(url: requestURL! as URL)
+                    
+                    //setting the method to post
+                    request.httpMethod = "POST"
+                    
+                    //getting values from text fields
+                    let scoreStat = score
+                    let highscoreStat = highScore
+                    
+                    //creating the post parameter by concatenating the keys and values from text field
+                    let postParameters = "score="+String(scoreStat)+"&highscore="+String(highscoreStat);
+                    
+                    //adding the parameters to request body
+                    request.httpBody = postParameters.data(using: String.Encoding.utf8)
+                    
+                    
+                    //creating a task to send the post request
+                    let task = URLSession.shared.dataTask(with: request as URLRequest){
+                        data, response, error in
+                        
+                        if error != nil{
+                            print("error is \(error)")
+                            return;
+                        }
+                        
+                        //parsing the response
+                        do {
+                            //converting resonse to NSDictionary
+                            let myJSON =  try JSONSerialization.jsonObject(with: data!, options: .mutableContainers) as? NSDictionary
+                            
+                            //parsing the json
+                            if let parseJSON = myJSON {
+                                
+                                //creating a string
+                                var msg : String!
+                                
+                                //getting the json response
+                                msg = parseJSON["message"] as! String?
+                                
+                                //printing the response
+                                print(msg)
+                                
+                            }
+                        } catch {
+                            print(error)
+                        }
+                        
+                    }
+                    //executing the task
+                    task.resume()
+
                 }
             }
         }

        
        
    }
    
    func setupBackground(){
        backgroundColor = UIColor.black
        self.anchorPoint = CGPoint(x: 0, y: 0)
        createStars()
        
        
    }
    


class GameOverScene: SKScene {
    
    let ScoreLbl = SKLabelNode()
    let HighScoreLbl = SKLabelNode()
    let homeTexture = SKTexture(imageNamed: "House")
    var homeBtn: SKSpriteNode!
    var retryBtn: SKSpriteNode!
    var gameOverBtn: SKSpriteNode!
    var scoreBLK: SKSpriteNode!
    var highscoreBLK: SKSpriteNode!
    var coinBLK: SKSpriteNode!
    let coinLbl = SKLabelNode()
    var coinIcon: SKSpriteNode!
    var cuppitLbl = SKLabelNode(fontNamed: "Thin")
    var statsBtn: SKSpriteNode!
    
    let URL_SAVE_TEAM = "http://theawkwardsquad.co/Service.php" //change to our url
    
    override func didMove(to view: SKView) {
        
