tried to fix bug related to temp1 and temp2 being removed