semantic checking partially implemented