aimd almost implemented