Look at the examples, they provide good implementations for various use cases. If you are still stuck, try contacting me.