more tempDoublePtr refactoring