functions to deal with attributes