Comment existing code

1 - Added comments to existing code.
2 - Update a few segments for easier readability.
3 - Added timing for preparation for some optimization.