a bunch of new type checking stuff