Selection of the first case

Correction of some bugs and implementation of Observer.