clean up and compress