Added code to understand Observer pattern