debugged compareTG