optional second argument sets type to match, default is type