Cleaned code

- Removed unnecessary whitespace
- Refactored loops to make use of LINQ
- etc