"xyf" in main.c was converted into a 3D array for just simplicity.