Description:
Check this out especially if you want the C++ code.