Added lots of comments which are my interpretation of what is going on in this file.  Stopped short of the VIVE compass stuff.