Added thresholding to future.
Corrected magnitude function.