Added simple documentation and a shebang and fixed a simple error at line 32.
Added newlines and sorted imports according to PEP-8.