implemented most of it, the iterator test is failing though.