memory corruption bug fixed; made realToComplex an allocatable array