fixed error in history check, gatesearch now also returns matrix collection
reworked tracing route, algorithm now takes level-by-level approach