change delete method so that it takes value instead of node