Added tests and changes