Added tests. Almost passing