added compression method