update comments
refactor inputLoop to read shared data from state controller