generic interpolate function - to test