Added cubic interpolation support, and made it substancially faster