fix index overflow (#12)

Merged Wuttke, Joachim requested to merge i12 into master

This resolves #12 (closed).

Not very elegant. Deeper analysis of the intercalated loops should allow for a more concise solution...

Merge request reports