Cleaned up the code.
Removed unnecessary imports.
Removed redundant comments.
Added port configuration.
Moved comments explaining purpose of functions to docstrings.
Changed " to ' since we are apprently using that.
String formatting is easier to read.