Reorganized directory + altered sorting functions