added support to read gzipped files
ammend
added testing script to tests seg. faults