added ability to choose number of lines to process