Sex is preprogrammed by genes, tissues are organized during the larval period by hormones.