First version of flood fill