added dual resource counting