Adjusted everything to be more LINQy, to do as much as possible with one-liners.