adding analysis functions