codes from my phd