Neatened a few bits of code