in reply to variable treatment

On line 7, you probably meant $z = $x ^ $y.