more effichent leaf analysis by eliminating branch counts call