Added some comments to help explain things. Did some reorganizing. Got materials working.