update grav.py to suppor flexible file sizes and merge.py for new format of output