Changes to edit function:

- edit function re-implement
- implement a separate junit for add function
- implement a separate junit for edit function