Create index.php

the guts of the sorting algo