Adde a spec and worked on the python implementation a bit more.