added more stricter typechecking