finally solves the prime generator..