keep tag order (no reverse iteration)
determine array length only once in for loop
Merge pull request #27 from nrenner/tag-order

keep tag order (no reverse iteration)