[TASK] modified algorithm of fix sorting