Made some calculations work better with adaptive switching frequency