making notes work and various fixes