Merging changes. Stategraphs now work much better.