Some revision after running pylint after reddit user /user/NeedsMoreTest made many helpful suggestions