added snippets for singleton pattern - thread safe and not thread safe