Scientists unravel the mechanism behind memory in plants