Using new loop format to simplify loop
Fixing header&implementation const-ness differences

Fixes #183
Oops, fixing self-recursion