added getSnippet method