added algorithm for producer and product class