added distributeResources method