Water firm to pay out £40million to customers after Ofwat investigation