change to a function