Updating sorting function to sort by file index first, then by voltage