2nd iteration of code

re-worked functionality.
Merge branch 'master' into gh-pages