Rewrote using LINQ