private void GetNameFromField()        // get the players name from the input field before adding their score to the leaderboard
    {                                      // note the input box is limited to 20 characters in the inspector
        string name = inputNameField.text; // getting the text from the input field

        if (name == "")                    // if the name is blank
        {
            //show the error message asking for a name to be entered
            instance.GameOverCanvas.transform.GetChild(5).gameObject.SetActive(true);
        }
        else   // if there exists a name in the text box

        {
            inputNameField.text = "";            // resetting the text field for the next player
            // send name and score to the CheckScore method
            leaderboard.CheckScore(name, score); // which once again checks the score is worthy of the leaderboard and then if so adds it to the leaderboard
            // hide input name object
            instance.GameOverCanvas.transform.GetChild(2).gameObject.SetActive(false);

            // show leaderboard
            instance.ShowLeaderBoard();                                                   // show leaderboard
            instance.LeaderboardCanvas.transform.GetChild(1).gameObject.SetActive(true);  // show game over
            instance.LeaderboardCanvas.transform.GetChild(3).gameObject.SetActive(true);  // show congratulations
            instance.LeaderboardCanvas.transform.GetChild(2).gameObject.SetActive(false); // hide better luck next time
        }
    }