9th commit with sorting and more readable