simplifying and optimizing algorithms.
fixed offset issue with linear and cubic inter.
Updating example page