updated analysis routine