Working port of Spinitorn python class.