Scientists discover how magic mushrooms work