my ($Axcoord, $Aycoord, $Azcoord, $Bxcoord, $Bycoord, $Bzcoord, $res_to_atom, $natres, $nseg, $beginning, $ending) = @_; ... $Axcord->[$counter] ...