begin a (very) rough implementation of the type checker