made sort more robust - can sort unlimited characters now