Added tests and docs