Added less than 10000 check to the check prime Last thing is lexographical sort of the final list