Code and packages for my PhD papers