Code for finding labels