added workspace to flux2, corrected indices and input arguments to flux3