Big bug with file handler: I can write data well, but reading it causes some trace error which I cannot be bothered to fix. So I'll just work on making the step function way more efficient.
First line is the data width, then the sand particles of each cell per row.
In particular I've implemented a standardised complete FILE * reader without relying on fseek (which may not work for pipes).