made generateLabels public
avoid IndexOutOfBounds errors