Also see comment in the source on line 193, below, for explanation on the variables.