adding functions which were used for analysis