added sort round primes optimized