Cleaning up and adding some last analytic functions