added analysis algorithm