generic tree structure replaced to preserve sanity
added semantic error for modifying for-loop control variable inside loop