An ugly little script