Added dynamic memory for entries < 1000000