Added implementation of the observer
Using the observer pattern in the program