ideas for compressed mode encoding (attempt 2)