Update to sg.py and pattern.txt

stuff okay?