a better way of sorting strings