The worst PHP code I have ever written. Hey, I was in a hurry.