small interpolate code improvements, support more than 2 samples