Are you using `idx` in this loop? Doesn't seem like it? But this could be just me missing this because of the GitHub interface.