add some tests and changes