code for the label function

Completed