Splitting the string, and making it an even matrix is now in its own function. Added another helper function to find_contiguous_blocks() to tighten up some common code.