Merge andyacs file into socode.py

The poor fellow wrote his lonely function outside of everything else. This commit integrates it.