display the correct output at the end