Initialise index to 0 since the algorithm seems to depend on it
Merge pull request #112 from sjoelund/uninitialised

Initialise index to 0 since the algorithm seems to depend on it