added delete node algorithm