Added tests
Added logging