modified slightly to pass pep8 test