Updated docstrings, ran pyflakes and pep8