What's the purpose of storing `r` into `result`?