Working subtitle transform code