added memory management for multi dimensional ffts