completed port of several analytics packages as well as analytics main