Tried to fix some indenting
Added connected components back