This looks very much like an exercise and if so it's a learning opportunity for you. I suggest you give it a go and if you get stuck with some concrete problem then come back here and ask the question together with providing as much of the work you've already done to resolve it (eg. the code which is not working).