tweak white space, remove unneeded lines, change variable names, make DRY