updated output code to reflect changes