Fix finnal sorting

Vadym Tishchenko requested to merge vadym/final_sorting into master
Edited by Bogdan Slusarenko

Merge request reports