changed rows order in links file, debug output improved