adding diagnostics; correcting argument passage in stress calculation routine