Added option to change type of interpolation
bug fixes