move var into fn
move branches out of main if-tree
reindent
shorten variable name
use python infix idiom for putting int into string
break up long lines