I'm glad you find the code and web site helpful. That's their purpose.

You're going in the wrong direction. Read the PulsIn/PulsOut sections in the manual. It uses 4MHz and 20MHz as examples and indicates you need to multiply instead of dividing.