Use old API.

Imported the example provided by GPLK to use old API, fixes #1.