Added typechecking