cleaned up product state, added documentation to several files