adding the 'plugin' pattern
cleaned up with jshint.com
rename and reformat