self snippet code