My personal re-implementations of different bits of code