updated a lot of typechecking