chopping compression file into functions