added interpolation code