mid implementation of flood fill ('4D')