Update the code to modify to work with 20000 records