code snippets for self practice