comments added and issues fixed

- more comments added
- issues related to having an empty noteset table in database should now
be resolved