rename argument type to typeval to avoid using a built-in