swap order of config and work functions
add comment
move summary functions out of main worker function
continue generalisation
remove redundant uses of variable
make config setup marginally more readable
remove redundant variable