go implementation of WAND algorithm