changed calculation to avoid breaking trending