Small fix, more cleanup:
- initialize j in the correct place
- better zero start date implementation
- more organized printf of file format