type checker

besides one nullptr error, static type checker seems to be working.