updated SNAP code