Working version of smith.py, as well as testing.