Refactoring temp calcs to function, it\'s broken. netops will fix it