removed commented out code
added a TODO: line
vars i and currentstate are defined within the function, not within for loop blocks