change ivim to one function