new code for analysis