some changes to analyze method