Improved comments and readability