Adding pathExists and MinHeap