did you read Funkymonk's or my response?
All you need to modify your code is explained there, you'll have to read some documentation and you'll get it wrong a few times, but try and resolve it yourself, it's not impossible and the supplied pointers should ease the path to your desired goal.