Naive Solution

Here's my naive solution. It's fairly modularized. Hope you guys like
it.