An integrated approach to the optimisation of water usage and discharge in pulp and paper plants