Added more detailed comments to the source-code