PEP8'd a bit more or something. No idea how best to handle the long lines.