main snippet