Agreement reached to end lawsuit against Flathead county businesses