adjustments to algorithm (R**2)