Ideal code