Final implementation of stress calculator.