Split code into different functions and changed logic on add/remove/display notes