I'm not keen on this code. It doesn't follow conventional naming, has some inefficiencies and passes RFs by pointer for some reason. It's good to have an example like this - it's requested regularly - but needs some tidying up.
Hi! You are right. I am already submit some changes.