void ResponsePhase()
    {
        if (!e_respCall)
        {
            inputGameobjectRef.SetActive(true);                                   // show text input field
            inputRef.ActivateInputField();                                        // activate text input field
            inputRef.text = "";                                                   // set text input field to be blank

            trialCounterRef.SetActive(true);                                      // show trial counter
            m_TrialNumber.UpdateTrialNumber(trialNumber, m_ExpSetup.totalTrials); // update trial number

            Debug.Log("Waiting for subject response...");
            e_respCall = true;
        }

        // Wait for the subject's response
        inputRef.Select();                              // select text input field
        if (Input.GetKeyDown(KeyCode.KeypadEnter))
        {
            if (inputRef.text == "")
            {
                Debug.Log("input is empty");
            }
            else if (inputRef.text != "")
            {
                resp = int.Parse(inputRef.text);                            // convert string input to int
                inputRef.DeactivateInputField();                            // deactivate text input field
                inputGameobjectRef.SetActive(false);                        // hide text input field

                // store the trial's info into the trialinfo csv
                m_ResponseData.WriteData(targetColor, targetOrientation, targetApperances, resp);

                responseDone = true;
            }
        }
    }
    void ResponsePhase()
    {
        generalTimer += Time.deltaTime;

        // make sure no extra objects are floating around
        DestroyExtra("DistractorClone", 0);
        DestroyExtra("TargetClone", 0);

        if (!e_respCall)
        {
            DestroyClones("DistractorClone");           // destroy central objects (distractors)
            DestroyClones("TargetClone");               // destroy central objects (targets)
            DestroyClones("FlickerClone");              // destroy peripheral objects
            fixationObjectRef.SetActive(false);         // hide fixation cross
            inputGameobjectRef.SetActive(true);         // show text input field
            inputRef.ActivateInputField();              // activate text input field
            inputRef.text = "";                         // set text input field to be blank

            e_respCall = true;
            Debug.Log("Waiting for subject response...");
        }

        // Wait for the subject's response
        inputRef.Select();                              // select text input field
        if (!e_feedbackCall && Input.GetKeyDown(KeyCode.KeypadEnter) || Input.GetKeyDown(KeyCode.Return))
        {
            if (inputRef.text == "")
            {
                Debug.Log("input is empty");
            }
            else if (inputRef.text != "")
            {
                resp = int.Parse(inputRef.text);                            // convert string input to int

                // store the trial's info into the trialinfo csv
                bool writeDataDone = m_TrialInfoDataConj.WriteData(peripheralDirection, distNumTemp,
                                                                   targetCount, resp, targetApperanceTime);

                // Make sure data written before moving on
                if (writeDataDone)
                {
                    // add number of correct trials
                    numCorrect = numCorrect + m_TrialInfoDataConj.CorrectResponseCalc(targetCount, resp);
                    Debug.Log("Num Trials Correct = " + numCorrect);

                    inputRef.DeactivateInputField();                            // deactivate text input field
                    inputGameobjectRef.SetActive(false);                        // hide text input field

                    if (adjustCoherence)
                    {
                        m_AdjustCoherenceConj.AdjustTargetNum(targetCount, resp, rightDirection, peripheralDirection);
                        feedbackGameobjectRef.SetActive(true);                      // activate feedback text
                        feedbackRef.text = targetCount.ToString();                  // show targetcount as string input
                    }
                    else
                    {
                        feedbackGameobjectRef.SetActive(true);                      // activate feedback text
                        feedbackRef.text = targetCount.ToString();                  // show targetcount as string input
                    }

                    trialNumber++;                                                          // increment trial number by one
                    trialCounterRef.SetActive(true);                                        // show trial counter
                    m_TrialNumber.UpdateTrialNumber(trialNumber, m_ExpSetup.totalTrials);   // update trial number

                    e_feedbackCall = true;
                }
            }
        }

        // Wait to move on from feedback
        if (e_feedbackCall && Input.GetKeyDown(KeyCode.Space) && generalTimer > aftereffectTime)
        {
            feedbackGameobjectRef.SetActive(false);         // hide feedback
            trialCounterRef.SetActive(false);               // hide trial counter

            generalTimer = 0;
            responseDone = true;
        }
    }