sorting for intergers without memcopy