Custom output refined

Custom output refined
Credit: Norm Tovey-Walsh