Lots more commenting of code bodies. Added TODO markers to show what
needs work and also areas I didn't understand