Updated the ANS implementation on the methodology, added headers, plus some minor flow changes