Collapse of the wavefunction