now functioning with labels