add tests and changes in methods of implementation