Added sldg.py

Added the main (and only) piece of code.