part of delete function finished