swapped in/out arguments to interp_func. Improved comments