Notes on typechecking