altering bond length code,now finds max z