Consider
1) adding
tags around the posted code in your question above so that it is readable and thus understandable, and
2) adding some text describing just where you're stuck, what you've...