sort attributes of class