Adding the example for you guys... read carefully I think i got everything