Added and improved comments for clarity