added method functionality in functions.js
Merge branch 'master' of https://github.com/charliejl28/polly