Declared temp Node variable and removed duplicated temp variables.