moving deletion code