hoist loop/while and inf loops