v3.3 added replace/compress

basic working version without statistics and error handling