changed objective function to reflect accurate r-squared calculation