added main snippet