Updated code

added functionality and updates style again.
Merge branch 'master' into gh-pages