Import of Sébastien Ronsse's repo. Please find the official code repository on the project's page.