algorithm: publisher-consumer-problem: some changes