added analysis function