more improvements to run over small txt files