Added analysis to main functionality