fix a and d codes