fixed impl and more tests