Semantic checking almost done