We have all been there.
Sitting in the kitchen trying to waft away a fruit fly as it buzzes mindlessly around your head.
But according to a new study, the mindless flight paths of the fruit fly, might not be quite as mindless as first thought.
Research carried out at the University of Oxford has found that - like humans - the fruit fly makes conscious decisions and can spend longer deliberating over the more difficult of them.
The study, which was set up by the University of Oxford’s Centre for Circuits and Behaviour, was aimed at finding out about the cognitive processes in small insects in order to see whether the findings could help us establish a better understand of the human mind.
As part of the experiment, researchers offered the fruit flies a choice between a smell at a dangerous odour level and then one that was a lot weaker.
The flies did well when the safe option was four or five times weaker than the more dangerous smell, but found it a more difficult and took more time when the differences were more acute.
Professor Gero Miesenböck, whose team did the work at the University of Oxford's Centre for Circuits and Behaviour, said: “This is the clearest evidence yet of a cognitive process running in a very simple brain
"People tended to think of insects as tiny robots that just respond reflexively to signals from the environment. Now we know that's not true."
After discovering that the flies took more time to make difficult decisions, researchers then looked for those fruit flies that took the longest over their decision-making to find out whether there was a genetic explanation for their indecisiveness.
The team found that the indecisiveness in the flies could be traced to mutations in the FOXP gene.
The lower the level of the FOXP gene in the fly, the longer it would take them to make the decision.
Shamik DasGupta, the study's lead author explained: “Before a decision is made, brain circuits collect information like a bucket collects water
"Once the amount of accumulated information has risen to a certain level, the decision is triggered. When FoxP is defective, either the flow of information into the bucket is reduced to a trickle, or the bucket has sprung a leak."
Professor Simon Fisher the man attributed with discovering FOXP gene told the BBC that the findings exciting and contributed to a “fascinating picture” of the gene and its history.
He said: It turns out that this is a gene that has been around for a really long time in evolutionary history, doing interesting things in the brain."
It is now hoped that the discoveries will help researchers better understand cognitive development defects in humans and help develop treatments for them in the future.