Implementing a Transformer From Scratch