Last year, I was surprised to find my female mandarin duck was turning into a male. Even as a zoology graduate and someone who has kept birds in an aviary since I was 10 years old, I had absolutely no idea this could happen, so I started investigating, and it turns out that the way birds express their sex is a fiendishly complex affair.
Mandarin ducks are a small species of tree-nesting duck that originates from China.
They have been kept in captivity in the UK for decades after bird keepers became enamoured by the male's incredible breeding plumage.
This plumage is a secondary sexual characteristic of the males, and is dependent on the time of year, with males moulting out of a female-like dull brown colouration in the Autumn.
My female, being happily paired with a male mandarin in my aviary, bucked this trend by growing male feathers. What happened?
In finding out what was actually happening, it's important to know what defines a male and female.
We investigated Mandarin ducks after Du from Singapore asked us: "Why do we have males and females?" If you've got a science question you want BBC CrowdScience to look into, get in touch via the form below.
If you are reading this page on the BBC News app, you will need to visit the mobile version of the BBC website to submit your question.
You'd think sexual characteristics - the presence of a penis, or mammary glands, or colourful plumage - might determine male and female, but when it comes to sex, size is everything.
Sexual reproduction nearly always happens through the combination of a large cell and a small cell, each containing half the usual genetic information from two individuals of the same species.
A male is simply the individual that provides the smaller of the two cells, while a female provides the larger. But the genetic control of which individual provides the larger and the smaller reproductive cells - and the corresponding sexual characteristics - differs enormously between mammals, birds, reptiles, fish and insects.
In both mammals and birds, chromosomes dictate sex. Humans have 23 pairs of these packages of bunched up DNA in each cell of the body, and sex is determined by the last pair known as X and Y.
The presence of a Y chromosome in humans leads to the development of a man (XY), whereas women have a repeated X chromosome (XX).
The male sexual characteristics coded for on the Y chromosome cause the production of testosterone, which suppresses the development of breasts and wider hips. So it can be said that female is the default sex in humans.
But to understand why female ducks can start reverting to a male appearance, it's important to realise that their sex determination system is reversed compared with mammals.
The sex chromosomes in birds are known as Z and W, and the presence of a W chromosome causes the development of a female (ZW). Without this, male characteristics develop (ZZ); and so for birds, male is the default sex.
Male mandarin ducks develop their incredible oranges, greens and reds when they start having to woo their female partner each the Autumn. So last October, I saw the normal development of my own male mandarin duck, but having just the one male, I didn't expect his mate to start developing the classic orange sail feathers that distinguish the males.
The male characteristics are controlled by that Z chromosome and the "male genes" it holds. But with females also having a Z chromosome, what's stopping her developing the colourful plumage of the male every year?
The answer lies in her ovary. Nearly all birds only develop a single functional ovary which pumps out female hormones, including oestrogen. In waterfowl it is the left ovary that functions, while the right side ovary remains a tiny ball of cells.
The oestrogen released by the functioning ovary inhibits the Z chromosome genes that would trigger male hormones, and male characteristics. So oestrogen in birds is the sexualising hormone.
Oestrogen in birds has a similar but opposite function to what we see with human testosterone, which restricts the production of female hormones.
Single point failure
With just a single ovary, female birds have all their eggs in one basket. And sometimes that ovary can die through infection, disease or injury.
And with no spare, ovary loss completely halts the release of oestrogen, removing the hormone that suppresses the male genes on the Z chromosome.
Male plumage therefore grows on the female in line with the changes in season. But I had never considered that my bird would be changing anything more than plumage.
That was until I spoke with the bird expert Prof Tim Birkhead.
Having been a lecturer of mine at the University of Sheffield, I knew that what Tim didn't know about bird sex hadn't been discovered yet.
Tim told me that in rare cases, after the loss of the suppressing oestrogen hormones, the undeveloped right ovary in the duck begins to develop in response to male genes on the Z chromosome.
This has been found through dissection and various experiments to remove the ovaries of living birds. Without restricting female hormones, the cells of the right side vestigial ovary masculinise, and can develop into a testis. This sperm has even been shown to be functional and can lead to the successful fertilisation of eggs.
In one exceptional case, a female-to-male convert - that happened to be a chicken - fathered two chicks. So it's possible for female to male sex changing birds to occur entirely naturally, and become fully reproductively active as a male.
But with female chromosomes, doesn't that mean she remains biologically female?
While the bird has changed physical sex, genetically she maintains her Z and W chromosomes in every cell. So although the chromosomal arrangement affects the initial development of sexual characteristics, the W chromosome has little effect on the sex of the bird after maturity. And considering the definition of a biological male merely requires the production of the smaller sex cell, the bird can be biologically considered "male".
My mandarin pair stayed together after the change in the female's sex, and "he" never tried to pair with a female. But we will never know whether ducklings could have resulted.
Due to the underlying condition that causes the death of the ovary, birds that go through this natural sex change rarely remain healthy. My own duck developed a mysterious illness and died after about six months of the change in plumage.
But I did discover something incredible about birds and sex, so while his death was tragic, his existence was proof that in nature, anything is possible.