Stuff I had to code for the prologin contest (made in 2010)