save buffer contents of x and y instead of overwriting them blindly