completely fixed auto adjust algo.