update AB serial algorithm