Analyze function