Added compress function and fixed a little bug