-updated output code