Some links that may be useful:

This project gratefully uses the following code: