added wave function