Phenotypes appear in legend
phenotypes logic added, streamlined code