Pass i value to pygen_A