copied over zip file reading function