analysis functions