added compact output function