added pathdist to gathering, fixed two bugs in there and added back in the swithc through markers for gathering