converting script to sue single static assignment