Hi,
There are plenty of exemple in this forum. Have a look at this thread for exemple.
And if I remember correctly @GoToLoop did some utility functions to help with that.