finished local switching functionality; fixed bugs in local xlink search algorithm