Updated source + comments

Added bits to tailor the code to the problem and threw in a lot of
comments