Cleaned up if condition for analysis mode