Optimal strategies for the recovery of material and energy from MSW