Added composite function

https://github.com/kfgodel/diamond/issues/206