New comments

Updated the code with additional comments and logic for path viewing and detection.