finish kda logic.