fixed interpolation algorithm and tests