implementing flowshop