first implementation - flood fill