Awa: correct algorithm