review a little logic in perform_analysis