refactored to calculate the maximum dollars available to distribute based on the users' funds available