Integrating the bucking operation with production control in sawmilling