fixed a bug with "weighted interpolation function"