Merge pull request #127 from timzehta/functions