well looks like to remove all occurrences you need in line 105 replace the return temp with


head = temp;