some  code snippets for sharing