Use indexes instead of data.
Merge pull request #1 from FunPika/patch-3

Fixes that Stwalkerster suggested