Changed getelements to an IEnumerable and removed IsValid