You don't actually use chunkLen outside the loop, you can just move it in to line 286