add functions for analysis