Adapted compress function. When called with one argument, it is assumed that this is also the name of the compressed file.