writing of wave-functions seems to work