defining foreach to acumulate points