various syntax changes from copying Python sources and munging into Ruby files