Added some comments, fixed a mistake