here i paste snippets of code for the future reference