Corrected the names of AG and LG
Further changes for xh correctness
Added option --oldver
Added support for xh mode
Minor changes for xh and bh modes