Fix code I wrote when I was drunk