what's frontierFlipped and edgeTypeBackToFrontier? Add some explanation?