adjusted scroll algorithm