a better way to get the width of the text for the labels