Trying to print all Prime numbers up to 1000