changed method getCodes for returning one code