gloss-adding python program