fixes important issues by write unit test
adds new methods and new tests