Added a bit more comments and explanations