style edits, make more pythonic