alogrithm adjust