Added tests & changing the public api