Updated code. Fixed logic issues. Change trigger and recovery level calculations. Changed TriggerLevelAdjust to be a multiplication factor.