refactor a bit
Semantic Analysis. Lists and Undefined States