added code to analyze functions