snn function