added valueof function