clean namespace a bit, get rid of bug, where loopcount is not being incremented in certain case