generated the snippet OF CODE correctly