some more changes + some broken stuff
fleshing out condition for loop state machine