Added composite function

https://github.com/kfgodel/diamond/issues/206
Merge pull request #207 from kfgodel/206-composite_function

Added composite function