Implementing a Transformer