some janky attempts at refactoring (hit)

Basically I wanted to refactor out the loop command, into something
that uses recursion. This isn't a good solution and I'm not sure it
even works, honestly.