Not Just My Own Function

Spotted some errors which I fixed so that socode.py actually runs. Also added my own function which I kind of like.
If you have trouble merging, I can rebase off of your master and handle the conflicts myself :)