added functionality to display the variable that is clicked