Some crappy code I wrote