finished smart code
Merge pull request #35 from gvorbeck/enhancement-smart-js-functions

finished smart code