compress and format