could you provide me with a sample code that do this?