fixed labels and checkIfDisplay(d,e) function