Thanks for pointing me in the right direction but can you give me a sample code?