turned transformation casting into a function that copies the memory to make working with gc'ed languages easier.
prevented button-x1/x2 from getting on the holded buffer