Correcting the Balboa magnetometer

Hi there!
Thanks for code and explanations.