added code snippets to post