added bulk function to calculate balances from environment