added a button to output to file, fixed sidebar clear issue.