Here's a first stab at distributeTasksAmongSlots.