Added a function as a source

From pull request #628