passed all tests except memory ones