removed unnecessary lines, better header style
removed unused var in restoring agenda buffer