The polished codes for r, droping the codes not used in the paper