loop variant for Identity working, loop for StateT is a work in progress