Hopefully this works, some minor adjustments to alpha / v code and added an isnan check to the E1 loop