optimizing calculation for cheapest constructions
setting up flag systeme