why `str`? From the docstring I assumed vals are numeric