The code i sent you is not in any case a complete application but only some hints
to follow.(like the add function that works as an example)
But i do not think you want to do it by yourself.
i think you want a fast copy paste solution.
in this case i can not help you.
try google or this link