Removed unused and faulty code from direct waveform calculations