parsed grid output into multiple files (was super slow before, this greatly improves things)
changed reading routines to handle new format