New transformer model

2nd attempt... (other changes discarded and not committed)