this will still infinite loop for fractional capacities.