fixed up delete bug and updated tests