Started writing compress function