added a for loop to deal with the first chunk problem
Merge pull request #12 from rrruss/master

added a for loop to deal with the first chunk problem