finish the main function of create and edit note
merge with zhang cheng's code