add comments and pep8 compliance to ring.py