Added the first version of the analyze algorithm.