Added analysis code