added function to delete nodes