Tweaked the flux calculations.
Made most of the functions output vectors instead of matricies.