Added docstring comments for readability, following pep 257, and made constants all uppercase.