Its also not too late to just delete the thread that gives a solution. However, sometimes (and I almost can't believe I am defending this) it helps to learn by example. Whereby something becomes clearer in seeing the solution.
To be frank, this is something that will come up frequently enough that I have no doubt that the OP will have to fully grasp the concept. I am not calling you wrong, however in this instance I deemed it reasonable enough to post a solution. If you had not noticed, I am not one to swiftly dole out freebies very often.

