Added Double Max Detection

Added double max detection with all dependencies.
First and second max are used to form a vactor and then states
detection use cosine similarity.