passing a callback to modify values