Refactored code with better variable names and fixed csv formatting and timestamps.

New CSV format:

x;y;z
x;y;z
x;y;z