Cleaned and commented the code

Now it's ready to rock and roll!