Imported PVA script form GravStrike (modified it a little)