Sorting

I wrote a small script that sorts the entries at the lowest level. I've explained how it's being done in the sort.py file. This is by no means an ideal solution - it is quite limited. In any case, for now, it is functional.