string parsing for output