add ensure clause snippets and more main function snippet