Added first test
Added tests and fixed bug