almost works, still bugs in delete