doing typechecking