added state diagram and TOC