Check out the Code Snippet for the similar question.