Implemented the observer design pattern