Working on IsBipartite method