Tidied up interpolation code