Added some comments and started debuggging