added support to save graphs. fixed some usability issues.