Improved speed of media checking, code readablity improvments
Fixed some errors to be more compatible with pep8
Improved code from terrible to acceptable