notes, sidebar, sum, some refactoring