Added LoopState
--Alex