This is rediculously old, so I'm going to re-write it when I get a chance.