Cumulate unique and non unique, added sorting to the table