I think you can do this with `if (abs($fpos->{y} - $yag) < $halfw and abs($fpos-{z} - $zag) < $halfw) {`