modified delete solution