G and M Codes