add more comments to both source files for better documentation