update: using enumerate

* also removed trailing whitespaces

Signed-off-by: Adrian Matejov <a.matejov@centrum.sk>
Merge pull request #10 from Adman/master

Enumerate instead of our own counter