Nearly got the general case working. Vectorized all elliptic integrals.