implemented all methods and added unit tests