This code would be more clear if you extracted out the anonymous function and iterated over `sys.frames()` instead of a vector of integers