turned functions into object functions