Temporal environmental variation and phenotypic plasticity: a mechanism underlying priority effects