modified 'once' c snippet