better way to iterate a range and skip k. no need to write the "ret *="-line twice
tweak the main loop a little
Merge pull request #1 from mathiasose/master

a couple little tweaks