More notes for the output problem.
Better solution proposed. Should work alright.