calculating percentages based on values