implementations for flood fill