Changed max_length to 7 + some cosmetic/pep8 changes