implemented basic producer-consumer arrangement