updated with assumption of quota <= stock