Optimizing vaccine allocation for pandemic influenza