Some renaming and added Scott encoding