consolidate
figure 2 fixed
all figs fixed
rename, indent
tidy syntax
Use formatR to tidy source
Further cleanup of code