MPU-6050, Attempting to understand Krodal's code

I suggest you get a book about elementary C++ programming.

We are happy to help explain difficult and tricky problems to you, and help you to solve them,
but if you expect people to sit here and manually transcribe
pages and pages of elementary explanations for you, because you don't know how to use google or wikipedia, or
read any of the multiple online tutorials, which are easily located.
And if you are unable to read, try youtube.