optimizes nested statements blocks
worked on variable references
checks for undefined and already defined identifiers.