finished semantic checker