reordered function calls in code to match their number, introduced a new function to create files with just x, y, z and E