Added some comments. View the diff to find questions that need answering.