updating unit tests and adding comments