adds wavefunction