It is not that hard... what language do you use? i have some sourcecode in C that i could share with you.