Beginning of type checker