checked in Jeff's refactor to make tuning parameters easier to adjust