Change code that calculates the stack usage, making it more accurate and smaller.