major modifications to lots of analysis routines