The heart has always been considered a vital structure but it was Aristotle that
really pushed for its supremacy. He thought it was an intelligent organ whose
position at the centre of the body made it important. Organs such as the brain and lungs existed simply to cool and cushion it; the source of heat in the body. Galen disagreed with this notion. He argued that the liver must be the primary organ of the body because of its role in the production of the humours, which were the basis
of health at that time. Its huge size also helped in its play for the top. In contrast,
the brain has had a rough ride over the centuries. Initially thought to be a source of
phlegm, it was not until relatively recently that its true complexity has been
appreciated. Even today, we have barely scratched its surface.
The pineal gland, part of the endocrine system, secrets melatonin.
Saying it does otherwise is akin to this.
https://prism.ucalgary.ca/bitstream/handle/1880/47541/Reynolds_2007.pdf;jsessionid=E43987AFCF9FC83DB3A4EC10A1591BDC?sequence=1