Now with more comments!

Same code as initial commit, but with more detailed comments.