implemented Publisher/Subscriber pattern

#14