extend output_len's functionality a bit