loop variant for StateT working, but need to test to depth that would otherwise blow the recursive impl