Add function.
Fix return value.
Merge pull request #1 from geonmo/function

Function