nan_iteration
fix in nan_iteration
further fix in nan_iteration
prime function update