semantic analysis almost done