Small comments and whitespace added for better readability and understanding.