rewritten as a small PHP script