Added A3 algorithm