the code now ignore numbers greater than 1000