added label function, importing Ups code from gabrielbull