Added some logic for keeping track of slots remaining for each shift