Add some additional comments in the loop explaining what you are doing (it's clear to me but it may not be to someone who is not familiar with the code).