second take on the SBS format output (work in progress)